<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="list" checkbox="false" fitColumns="true"
  	 title="实验室使用申请" actionUrl="labApplyController.do?applyDatagrid" idField="id" fit="true" queryMode="group">
  	 	 <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="100"></t:dgCol>
		<t:dgCol title="实验室名称"  field="name" query="true" queryMode="single" width="100"></t:dgCol>
		<t:dgCol title="编号"  field="no" query="false" queryMode="single" width="120"></t:dgCol>
		<t:dgCol title="所属实验中心"  field="expCenter.name" query="false" queryMode="single" width="60"></t:dgCol>
		<t:dgCol title="位置"  field="address" query="false" queryMode="single" width="50"></t:dgCol>
		<t:dgCol title="开放开始日期"  field="beginDate" formatter="yyyy-MM-dd"  query="true" queryMode="group" width="100"></t:dgCol>
		<t:dgCol title="开放结束日期"  field="endDate" formatter="yyyy-MM-dd" query="true" queryMode="group" width="100"></t:dgCol>
		<t:dgCol title="操作" field="opt" width="40"></t:dgCol>
		<t:dgFunOpt funname="apply(id)" title="申请"></t:dgFunOpt>
  </t:datagrid>
  </div>
 </div>
 <script>
 
 	$(document).ready(function(){
 		$("#listtb").find("input[name='beginDate_begin']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
 		$("#listtb").find("input[name='beginDate_end']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
 		$("#listtb").find("input[name='endDate_begin']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
 		$("#listtb").find("input[name='endDate_end']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
 	});
 
 	function apply(id){
 		window.location.href="labAppointApplyController.do?apply&labId="+id;
 	}
 	
 	 /**
 	 * 添加申请记录 
 	 */
 	 function apply(id){
 		 var addurl = "labApplyController.do?apply&labId="+id;
 		 $.dialog({
 				content: 'url:'+addurl,
 				lock : true,
 				zIndex: getzIndex(),
 				width:"420px",
 				height:"300px",
 				title:"使用申请",
 				opacity : 0.3,
 				fixed:true,
 				cache:false,
 			    ok: function(){
 			    	iframe = this.iframe.contentWindow;
 					saveObj();
 					return false;
 			    },
 			    cancelVal: '关闭',
 			    cancel: true /*为true等价于function(){}*/
 			});
 	 }
 </script>